package org.framework.core.error;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.framework.core.validate.exception.ValidationException;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.servlet.ModelAndView;

public interface ExceptionHandle {
	
	@ExceptionHandler(ValidationException.class)
	@ResponseStatus(HttpStatus.OK)
	public ModelAndView handleCustomException(HttpServletRequest request, HttpServletResponse response, Object handler, ValidationException ex);
	
	@ExceptionHandler({RuntimeException.class, Exception.class})
	@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
	public ModelAndView handleException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex);

}
